package net.wofly.sale.commodity.service.impl;

import java.util.List;

import javax.transaction.Transactional;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import net.wofly.sale.commodity.repository.ManufacturerRepository;
import net.wofly.sale.commodity.domain.Manufacturer;
import net.wofly.sale.commodity.service.IManufacturerService;

@Service("iManufacturerService")
@Transactional
public class ManufacturerServiceImpl implements IManufacturerService {

	@Autowired
	ManufacturerRepository manufacturerRepository;

	@Override
	public Manufacturer save(Manufacturer entity) {
		return manufacturerRepository.save(entity);
	}

	@Override
	public void delete(Manufacturer entity) {
		manufacturerRepository.delete(entity);
	}

	@Override
	public void delete(String key) {
		manufacturerRepository.delete(key);
	}

	@Override
	public Manufacturer findOne(String key) {
		return manufacturerRepository.findOne(key);
	}

	@Override
	public List<Manufacturer> save(List<Manufacturer> entityList) {
		return (List<Manufacturer>) manufacturerRepository.save(entityList);
	}
}
